<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../">
  <title data-ice="title">core/models/chat.js | API</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  <script src="script/manual.js"></script>
<link rel="stylesheet" href="./inject/css/0-vue.css"><link rel="stylesheet" href="./inject/css/0-app.css"><link rel="stylesheet" href="./inject/css/0-esdoc.css"><script src="./inject/script/0-custom.js"></script><meta name="description" content="&#x4F01;&#x4E1A;&#x5373;&#x65F6;&#x901A;&#x8BAF;&#x5E73;&#x53F0;"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="API"><meta property="twitter:description" content="&#x4F01;&#x4E1A;&#x5373;&#x65F6;&#x901A;&#x8BAF;&#x5E73;&#x53F0;"></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="position:relative; top:3px;" href="https://github.com/easysoft/xuanxuan.git"><img width="20px" src="./image/github.png"></a></header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/events.js~Events.html">Events</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createCommandObject">createCommandObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-executeCommand">executeCommand</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-executeCommandLine">executeCommandLine</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCommandContext">getCommandContext</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-registerCommand">registerCommand</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setCommandContext">setCommandContext</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-unregisterCommand">unregisterCommand</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-addContextMenuCreator">addContextMenuCreator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getInnerMenuItemsForContext">getInnerMenuItemsForContext</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getMenuItemsForContext">getMenuItemsForContext</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getMenuItemsFromCreator">getMenuItemsFromCreator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isCreatorMatch">isCreatorMatch</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isDividerItem">isDividerItem</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-removeContextMenuCreator">removeContextMenuCreator</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-showContextMenu">showContextMenu</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-tryAddDividerItem">tryAddDividerItem</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-tryRemoveLastDivider">tryRemoveLastDivider</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-deptsSorter">deptsSorter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-forEachMember">forEachMember</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getAllMembers">getAllMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getDept">getDept</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getDeptsTree">getDeptsTree</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getMember">getMember</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getRoleName">getRoleName</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-guessMember">guessMember</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initDepts">initDepts</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initMembers">initMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onMembersChange">onMembersChange</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-queryMembers">queryMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-removeMember">removeMember</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updateMembers">updateMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isMatchWindowCondition">isMatchWindowCondition</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onNoticeUpdate">onNoticeUpdate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updateNotice">updateNotice</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ready">ready</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sayReady">sayReady</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-completeDragNDrop">completeDragNDrop</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-disableGlobalShortcut">disableGlobalShortcut</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-emitAppLinkClick">emitAppLinkClick</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-enableGlobalShortcut">enableGlobalShortcut</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getUrlMeta">getUrlMeta</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isAutoLoginNextTime">isAutoLoginNextTime</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isSmallScreen">isSmallScreen</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onAppLinkClick">onAppLinkClick</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onReady">onReady</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-openUrl">openUrl</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-openUrlInApp">openUrlInApp</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-openUrlInBrowser">openUrlInBrowser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-openUrlInDialog">openUrlInDialog</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-registerShortcut">registerShortcut</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-reloadWindow">reloadWindow</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTitle">setTitle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-showMobileChatsMenu">showMobileChatsMenu</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-triggerReady">triggerReady</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-unregisterGlobalShortcut">unregisterGlobalShortcut</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-contextMenuCreators">contextMenuCreators</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-DATA_CHANGE_DELAY">DATA_CHANGE_DELAY</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-events">events</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-app">app</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-depts">depts</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-members">members</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-roles">roles</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-DEFAULT">DEFAULT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-requestAttention">requestAttention</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-isReadyed">isReadyed</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-clearCopyCodeTip">clearCopyCodeTip</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-entryParams">entryParams</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-globalHotkeys">globalHotkeys</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-isGlobalShortcutDisabled">isGlobalShortcutDisabled</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-maxUrlCacheSize">maxUrlCacheSize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-quit">quit</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-urlMetaCaches">urlMetaCaches</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#db">db</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/db/database.js~Database.html">Database</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-DB_VERSION">DB_VERSION</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lastCreateDb">lastCreateDb</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-db">db</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#im">im</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-countChatMessages">countChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createChatMessage">createChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createCountMessagesTask">createCountMessagesTask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-deleteLocalMessage">deleteLocalMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-forEachChat">forEachChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getAllChats">getAllChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getChat">getChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getChatCategories">getChatCategories</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getChatFiles">getChatFiles</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getChatMessages">getChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getChatMessagesInQueue">getChatMessagesInQueue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getContactChat">getContactChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getContactsChats">getContactsChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getGroupsChats">getGroupsChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLastActiveChat">getLastActiveChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLastRecentChat">getLastRecentChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getOne2OneChatGid">getOne2OneChatGid</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPublicChats">getPublicChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getRecentChats">getRecentChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initChats">initChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-loadChatMessages">loadChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatMessages">onChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatsInit">onChatsInit</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onFetchQueueFinish">onFetchQueueFinish</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-processChatMessageQueue">processChatMessageQueue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-queryChats">queryChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-removeChat">removeChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-saveChatMessages">saveChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-searchChatMessages">searchChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-searchChats">searchChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updateChatMessages">updateChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updateChats">updateChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updatePublicChats">updatePublicChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkFileCache">checkFileCache</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkUploadFileSize">checkUploadFileSize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-downloadFile">downloadFile</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-loadFiles">loadFiles</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-searchFiles">searchFiles</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-uploadFile">uploadFile</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-uploadImageFile">uploadImageFile</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPlainTextOfChatMessage">getPlainTextOfChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-runChatNoticeTask">runChatNoticeTask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatAddmember">chatAddmember</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatCategory">chatCategory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatChangename">chatChangename</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatChangepublic">chatChangepublic</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatCreate">chatCreate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatDismiss">chatDismiss</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatGetlist">chatGetlist</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatGetpubliclist">chatGetpubliclist</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatHide">chatHide</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatHistory">chatHistory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatJoinchat">chatJoinchat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatMessage">chatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatMute">chatMute</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatNotify">chatNotify</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatSetcomitters">chatSetcomitters</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatStar">chatStar</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createBoardChatMessage">createBoardChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createChat">createChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createChatWithMembers">createChatWithMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createEmojiChatMessage">createEmojiChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createLocalChatWithMembers">createLocalChatWithMembers</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createTextChatMessage">createTextChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createUrlObjectMessage">createUrlObjectMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-dimissChat">dimissChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-exitChat">exitChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fetchChatsHistory">fetchChatsHistory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fetchPublicChats">fetchPublicChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-handleInitChats">handleInitChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-handleReceiveChatMessages">handleReceiveChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-inviteMembersToChat">inviteMembersToChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isFetchingHistory">isFetchingHistory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-joinChat">joinChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-kickOfMemberFromChat">kickOfMemberFromChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatHistory">onChatHistory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatHistoryEnd">onChatHistoryEnd</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatHistoryStart">onChatHistoryStart</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onReceiveChatMessages">onReceiveChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onSendChatMessages">onSendChatMessages</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-renameChat">renameChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendBoardChatMessage">sendBoardChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendChatMessage">sendChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendEmojiMessage">sendEmojiMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendFileMessage">sendFileMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendImageAsBase64">sendImageAsBase64</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendImageMessage">sendImageMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendSocketMessageForChat">sendSocketMessageForChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendTextMessage">sendTextMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setChatCategory">setChatCategory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setCommitters">setCommitters</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toggleChatPublic">toggleChatPublic</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toggleChatStar">toggleChatStar</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toggleHideChat">toggleHideChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toggleMuteChat">toggleMuteChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-updateChatHistory">updateChatHistory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-activeAndMapCacheChats">activeAndMapCacheChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-activeChat">activeChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-activeLastChat">activeLastChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-captureAndCutScreenImage">captureAndCutScreenImage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatDismissConfirm">chatDismissConfirm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatExitConfirm">chatExitConfirm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatRenamePrompt">chatRenamePrompt</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createCatureScreenContextMenuItems">createCatureScreenContextMenuItems</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createGroupChat">createGroupChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-emitChatSendboxFocus">emitChatSendboxFocus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-hasMessageContextMenu">hasMessageContextMenu</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isActiveChat">isActiveChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-linkMembersInText">linkMembersInText</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-mapCacheChats">mapCacheChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onActiveChat">onActiveChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onChatSendboxFocus">onChatSendboxFocus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onRenderChatMessageContent">onRenderChatMessageContent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onSendContentToChat">onSendContentToChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onSuggestSendImage">onSuggestSendImage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-renameChatCategory">renameChatCategory</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-renderChatMessageContent">renderChatMessageContent</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-sendContentToChat">sendContentToChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-CHATS_LIMIT_DEFAULT">CHATS_LIMIT_DEFAULT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MAX_RECENT_TIME">MAX_RECENT_TIME</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEARCH_SCORE_MAP">SEARCH_SCORE_MAP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-app">app</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-chats">chats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-fetchChatMessagesQueue">fetchChatMessagesQueue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-isGetChatMessagesQueueBusy">isGetChatMessagesQueueBusy</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-publicChats">publicChats</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MIN_PROGRESS_CHANGE_INTERVAL">MIN_PROGRESS_CHANGE_INTERVAL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lastNoticeChat">lastNoticeChat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lastNoticeInfo">lastNoticeInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-updateChatNoticeTask">updateChatNoticeTask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MAX_BASE64_IMAGE_SIZE">MAX_BASE64_IMAGE_SIZE</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-chatJoinTask">chatJoinTask</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-historyFetchingPager">historyFetchingPager</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-activeCaches">activeCaches</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-activedChatId">activedChatId</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-onRenderChatMessageContentListener">onRenderChatMessageContentListener</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#models">models</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/chat-message.js~ChatMessage.html">ChatMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/chat.js~Chat.html">Chat</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/entity-schema.js~EntitySchema.html">EntitySchema</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/entity.js~Entity.html">Entity</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/file-data.js~FileData.html">FileData</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/member.js~Member.html">Member</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/models/notification-message.js~NotificationMessage.html">NotificationMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-dataURItoBlob">dataURItoBlob</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-CONTENT_TYPES">CONTENT_TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-OBJECT_TYPES">OBJECT_TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEND_WAIT_TIME">SEND_WAIT_TIME</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-STATUS">STATUS</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-TYPES">TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-COMMITTERS_TYPES">COMMITTERS_TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-DISMISS_VISIBLE_TIME">DISMISS_VISIBLE_TIME</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-STATUS">STATUS</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-TYPES">TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-TYPES">TYPES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-defaultValuesConveter">defaultValuesConveter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-CATEGORIES">CATEGORIES</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MATCH_SCORE_MAP">MATCH_SCORE_MAP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MATCH_SCORE_MAP">MATCH_SCORE_MAP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-STATUS">STATUS</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#network">network</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/network/socket-message.js~SocketMessage.html">SocketMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/network/socket.js~AppSocket.html">AppSocket</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkUploadFileSize">checkUploadFileSize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getRanzhiServerInfo">getRanzhiServerInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-requestServerInfo">requestServerInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-listenMessage">listenMessage</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-API">API</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-LISTEN_TIMEOUT">LISTEN_TIMEOUT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-PING_INTERVAL">PING_INTERVAL</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#profile">profile</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/profile/user-config.js~UserConfig.html">UserConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/core/profile/user.js~User.html">User</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createUser">createUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCurrentUser">getCurrentUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLastSavedUser">getLastSavedUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isCurrentUser">isCurrentUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onSwapUser">onSwapUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onUserConfigChange">onUserConfigChange</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onUserStatusChange">onUserStatusChange</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setCurrentUser">setCurrentUser</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isPasswordWithMD5Flag">isPasswordWithMD5Flag</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-user">user</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-PASSWORD_WITH_MD5_FLAG">PASSWORD_WITH_MD5_FLAG</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-changeUserStatus">changeUserStatus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkServerVersion">checkServerVersion</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkVersionSupport">checkVersionSupport</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fetchUserList">fetchUserList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-login">login</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-logout">logout</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onUserLogin">onUserLogin</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-onUserLoginout">onUserLoginout</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-tryGetTempUserInfo">tryGetTempUserInfo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatError">chatError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatKickoff">chatKickoff</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatLogin">chatLogin</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatLogout">chatLogout</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatSessionID">chatSessionID</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatSettings">chatSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatUserChangeStatus">chatUserChangeStatus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatUserchange">chatUserchange</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-chatUsergetlist">chatUsergetlist</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-MIN_SUPPORT_VERSION">MIN_SUPPORT_VERSION</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-TIMEOUT">TIMEOUT</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-lastGetTempUserCall">lastGetTempUserCall</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-socket">socket</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-tempUserIdList">tempUserIdList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-EVENT">EVENT</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#todo">todo</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createTodo">createTodo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createTodoFromMessage">createTodoFromMessage</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><h1 data-ice="title">core/models/chat.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import Entity from &apos;./entity&apos;;
import Status from &apos;../../utils/status&apos;;
import Lang from &apos;../../lang&apos;;
import Pinyin from &apos;../../utils/pinyin&apos;;
import ChatMessage from &apos;./chat-message&apos;;

/**
 * &#x804A;&#x5929;&#x72B6;&#x6001;&#x7BA1;&#x7406;&#x5668;
 *
 * @private
 * @type {Status}
 */
const STATUS = new Status({
    local: 0,
    sending: 1,
    fail: 2,
    ok: 3,
}, 0);

/**
 * &#x804A;&#x5929;&#x7C7B;&#x578B;&#x8868;
 * @type {Object&lt;string,string&gt;}
 * @private
 */
const TYPES = {
    one2one: &apos;one2one&apos;,
    group: &apos;group&apos;,
    system: &apos;system&apos;,
    robot: &apos;robot&apos;
};

/**
 * &#x767D;&#x540D;&#x5355;&#x7C7B;&#x578B;&#x8868;
 * @type {Object&lt;string,string&gt;}
 * @private
 */
const COMMITTERS_TYPES = {
    admins: &apos;admins&apos;,
    whitelist: &apos;whitelist&apos;,
    all: &apos;all&apos;
};


/**
 * &#x5C06;&#x88AB;&#x5220;&#x9664;&#x804A;&#x5929;&#x6807;&#x8BB0;&#x4E3A;&#x9690;&#x85CF;&#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;&#x5355;&#x4F4D;&#x6BEB;&#x79D2;
 * @type {number}
 * @private
 */
const DISMISS_VISIBLE_TIME = 1000 * 60 * 60 * 24 * 90;

/**
 * &#x804A;&#x5929;&#x7C7B;
 *
 * @class Chat
 * @extends {Entity}
 */
export default class Chat extends Entity {
    /**
     * &#x5B9E;&#x4F53;&#x540D;&#x79F0;
     * @type {string}
     * @memberof Chat
     */
    static NAME = &apos;Chat&apos;;

    /**
     * &#x6210;&#x5458;&#x72B6;&#x6001;&#x7BA1;&#x7406;&#x5668;
     *
     * @static
     * @memberof Chat
     * @type {Status}
     */
    static STATUS = STATUS;

    /**
     * &#x804A;&#x5929;&#x7C7B;&#x578B;&#x8868;
     * @type {Object&lt;string,string&gt;}
     * @memberof Chat
     * @static
     */
    static TYPES = TYPES;

    /**
     * &#x767D;&#x540D;&#x5355;&#x7C7B;&#x578B;&#x8868;
     * @type {Object&lt;string,string&gt;}
     * @memberof Chat
     * @static
     */
    static COMMITTERS_TYPES = COMMITTERS_TYPES;

    /**
     * &#x6570;&#x636E;&#x5E93;&#x5B58;&#x50A8;&#x5B9E;&#x4F53;&#x5C5E;&#x6027;&#x7ED3;&#x6784;&#x7BA1;&#x7406;&#x5668;
     *
     * @type {EntitySchema}
     * @static
     * @memberof Chat
     */
    static SCHEMA = Entity.SCHEMA.extend({
        user: {type: &apos;int&apos;, indexed: true},
        type: {type: &apos;string&apos;, indexed: true},
        name: {type: &apos;string&apos;, indexed: true},
        createdDate: {type: &apos;timestamp&apos;, indexed: true},
        createdBy: {type: &apos;string&apos;, indexed: true},
        editedDate: {type: &apos;timestamp&apos;},
        lastActiveTime: {type: &apos;timestamp&apos;, indexed: true},
        dismissDate: {type: &apos;timestamp&apos;, indexed: true},
        star: {type: &apos;boolean&apos;, indexed: true},
        mute: {type: &apos;boolean&apos;, indexed: true},
        public: {type: &apos;boolean&apos;, indexed: true},
        admins: {type: &apos;set&apos;},
        members: {
            type: &apos;set&apos;,
            setter: (val, obj) =&gt; {
                obj._membersSet = null;
                return val;
            }
        },
        committers: {type: &apos;string&apos;},
        category: {type: &apos;string&apos;},
    });

    /**
     * &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x804A;&#x5929;&#x7C7B;&#x5B9E;&#x4F8B;
     * @param {Object&lt;string,any&gt;} data &#x804A;&#x5929;&#x5C5E;&#x6027;&#x5BF9;&#x8C61;
     * @param {string} [entityType=Chat.NAME] &#x5B9E;&#x4F53;&#x7C7B;&#x578B;&#x540D;&#x79F0;
     * @memberof Chat
     */
    constructor(data, entityType = Chat.NAME) {
        super(data, entityType);

        /**
         * &#x804A;&#x5929;&#x72B6;&#x6001;
         * @type {Status}
         * @private
         */
        this._status = STATUS.create(this.$.status);
        this._status.onChange = newStatus =&gt; {
            this.$.status = newStatus;
            if (typeof this.onStatusChange === &apos;function&apos;) {
                this.onStatusChange(newStatus, this);
            }
        };

        /**
         * &#x6700;&#x5927;&#x804A;&#x5929;&#x6D88;&#x606F;&#x6392;&#x5E8F;&#x7F16;&#x53F7;
         * @type {number}
         * @private
         */
        this._maxMsgOrder = 0;
    }

    /**
     * &#x83B7;&#x53D6;&#x6700;&#x5927;&#x804A;&#x5929;&#x6D88;&#x606F;&#x6392;&#x5E8F;&#x7F16;&#x53F7;
     * @memberof Chat
     * @type {number}
     */
    get maxMsgOrder() {
        return this._maxMsgOrder;
    }

    /**
     * &#x9012;&#x589E;&#x6700;&#x5927;&#x804A;&#x5929;&#x6D88;&#x606F;&#x6392;&#x5E8F;&#x7F16;&#x53F7;
     * @memberof Chat
     * @return {number} &#x6700;&#x5927;&#x804A;&#x5929;&#x6D88;&#x606F;&#x6392;&#x5E8F;&#x7F16;&#x53F7;
     */
    newMsgOrder() {
        this._maxMsgOrder += 1;
        return this._maxMsgOrder;
    }

    /**
     * &#x8C03;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&#x786E;&#x4FDD;&#x5B9E;&#x4F53;&#x62E5;&#x6709;&#x5408;&#x9002;&#x7684; GID &#x5C5E;&#x6027;
     *
     * @memberof Entity
     * @return {void}
     * @override
     */
    ensureGid() {
        if (this.isOne2One) {
            this.$.gid = Array.from(this.members).sort().join(&apos;&amp;&apos;);
        } else {
            super.ensureGid();
        }
    }

    /**
     * &#x83B7;&#x53D6;&#x6570;&#x636E;&#x5E93;&#x5B58;&#x50A8;&#x5B9E;&#x4F53;&#x5C5E;&#x6027;&#x7ED3;&#x6784;&#x7BA1;&#x7406;&#x5668;
     *
     * @readonly
     * @memberof Member
     * @type {EntitySchema}
     */
    // eslint-disable-next-line class-methods-use-this
    get schema() {
        return Chat.SCHEMA;
    }

    /**
     * &#x8BBE;&#x7F6E; ID &#x5C5E;&#x6027;
     * @param {number} remoteId  ID &#x5C5E;&#x6027;
     * @memberof Chat
     */
    set id(remoteId) {
        super.id = remoteId;
        this._status.change(remoteId ? STATUS.ok : STATUS.fail);
    }

    /**
     * &#x83B7;&#x53D6; ID &#x5C5E;&#x6027;&#x503C;
     * @memberof Chat
     * @type {number}
     */
    get id() {
        return this.$get(&apos;id&apos;);
    }

    /**
     * &#x83B7;&#x53D6;&#x72B6;&#x6001;&#x503C;
     * @memberof Chat
     * @readonly
     * @type {number}
     */
    get status() {
        return this._status.value;
    }

    /**
     * &#x83B7;&#x53D6;&#x72B6;&#x6001;&#x540D;&#x79F0;
     * @memberof Chat
     * @readonly
     * @type {string}
     */
    get statusName() {
        return this._status.name;
    }

    /**
     * &#x5224;&#x65AD;&#x5F53;&#x524D;&#x72B6;&#x6001;&#x662F;&#x5426;&#x662F;&#x7ED9;&#x5B9A;&#x7684;&#x72B6;&#x6001;
     * @memberof Chat
     * @param {number|string} status &#x8981;&#x5224;&#x65AD;&#x7684;&#x72B6;&#x6001;&#x503C;&#x6216;&#x72B6;&#x6001;&#x540D;&#x79F0;
     * @return {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x4E3A;&#x7ED9;&#x5B9A;&#x7684;&#x72B6;&#x6001;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x662F;
     */
    isStatus(status) {
        return this._status.is(status);
    }

    /**
     * &#x5224;&#x65AD;&#x5F53;&#x524D;&#x72B6;&#x6001;&#x662F;&#x5426;&#x662F;&#x6B63;&#x5E38;&#x72B6;&#x6001;
     * @memberof Chat
     * @return {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x4E3A;&#x6B63;&#x5E38;&#x72B6;&#x6001;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x662F;
     */
    get isOK() {
        return this.isStatus(STATUS.ok);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x7C7B;&#x578B;
     * @memberof Chat
     * @type {string}
     */
    get type() {
        let type = this.$get(&apos;type&apos;);
        if (!type) {
            const {members} = this;
            type = (members &amp;&amp; members.size === 2) ? TYPES.one2one : TYPES.group;
        }
        return type;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x4E3A;&#x673A;&#x5668;&#x4EBA;&#x804A;&#x5929;&#x7C7B;&#x578B;
     * @memberof Chat
     * @type {boolean}
     */
    get isRobot() {
        return this.type === TYPES.robot;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x7C7B;&#x578B;
     * @param {string} type &#x804A;&#x5929;&#x7C7B;&#x578B;
     * @memberof Chat
     */
    set type(type) {
        this.$set(&apos;type&apos;, type);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;&#x7C7B;&#x578B;
     * @memberof Chat
     * @type {boolean}
     */
    get isOne2One() {
        return this.type === TYPES.one2one;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x4E3A;&#x5DF2;&#x5220;&#x9664;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get isDeleteOne2One() {
        return this.isOne2One &amp;&amp; this._isDeleteOne2One;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x4E3A;&#x5DF2;&#x5220;&#x9664;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;
     * @param {boolean} flag &#x4E3A;&#x5DF2;&#x5220;&#x9664;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;
     * @memberof Chat
     */
    set isDeleteOne2One(flag) {
        if (this.isOne2One) {
            this._isDeleteOne2One = flag;
        }
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x8BA8;&#x8BBA;&#x7EC4;
     * @memberof Chat
     * @type {boolean}
     */
    get isGroup() {
        return this.type === TYPES.group;
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x5206;&#x7EC4;
     * @memberof Chat
     * @type {string}
     */
    get category() {
        return this.$get(&apos;category&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x5206;&#x7EC4;
     * @param {string} name &#x804A;&#x5929;&#x5206;&#x7EC4;
     * @memberof Chat
     */
    set category(name) {
        return this.$set(&apos;category&apos;, name);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x540D;&#x79F0;
     * @memberof Chat
     * @type {string}
     */
    get name() {
        return this.$get(&apos;name&apos;, `[Chat-${this.id}]`);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x540D;&#x79F0;
     * @param {string} newName &#x804A;&#x5929;&#x540D;&#x79F0;
     * @memberof Chat
     */
    set name(newName) {
        this.$set(&apos;name&apos;, newName);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x663E;&#x793A;&#x540D;&#x79F0;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;&#x5219;&#x8FD4;&#x56DE;&#x5BF9;&#x65B9;&#x6210;&#x5458;&#x540D;&#x79F0;&#xFF0C;&#x5426;&#x5219;&#x8FD4;&#x56DE;&#x804A;&#x5929; `name` &#x5C5E;&#x6027;&#x503C;
     * @param {{members: {get: function(id: number):Member}}} app &#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x6210;&#x5458;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @param {boolean} [includeMemberCount=false] &#x662F;&#x5426;&#x5305;&#x542B;&#x804A;&#x5929;&#x6210;&#x5458;&#x6570;&#x76EE;
     * @return {string} &#x804A;&#x5929;&#x540D;&#x79F0;
     * @memberof Chat
     */
    getDisplayName(app, includeMemberCount = false) {
        const {name} = this;
        if (this.isRobot) {
            includeMemberCount = false;
        }
        if (this.isOne2One) {
            const otherOne = this.getTheOtherOne(app);
            return otherOne ? otherOne.displayName : Lang.string(&apos;chat.tempChat.name&apos;);
        }
        if (this.isSystem) {
            if (includeMemberCount) {
                return Lang.format(&apos;chat.groupName.format&apos;, name || Lang.string(&apos;chat.systemGroup.name&apos;), Lang.string(&apos;chat.all&apos;));
            }
            return name || Lang.string(&apos;chat.systemGroup.name&apos;);
        }
        if (name !== undefined &amp;&amp; name !== &apos;&apos;) {
            if (includeMemberCount) {
                return Lang.format(&apos;chat.groupName.format&apos;, name, this.getMembersCount(app.members));
            }
            return name;
        }
        return `${Lang.string(&apos;chat.group.name&apos;)}${this.id || `(${Lang.string(&apos;chat.tempChat.name&apos;)})`}`;
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x540D;&#x79F0;&#x7684;&#x62FC;&#x97F3;&#x5B57;&#x7B26;&#x4E32;&#xFF08;&#x7528;&#x4E8E;&#x6392;&#x5E8F;&#x6216;&#x641C;&#x7D22;&#xFF09;
     *
     * @param {{members: {get: function(id: number):Member}}} app &#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x6210;&#x5458;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {string} &#x62FC;&#x97F3;&#x5B57;&#x7B26;&#x4E32;
     * @memberof Chat
     */
    getPinYin(app) {
        if (!this._pinyin) {
            const str = app ? this.getDisplayName(app, false) : this.name;
            this._pinyin = Pinyin(str);
        }
        return this._pinyin;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x6536;&#x85CF;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get star() {
        return this.$get(&apos;star&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x5DF2;&#x6536;&#x85CF;&#x6B64;&#x804A;&#x5929;
     * @param {boolean} star &#x5DF2;&#x6536;&#x85CF;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     */
    set star(star) {
        this.$set(&apos;star&apos;, star);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x8BBE;&#x7F6E;&#x4E3A;&#x514D;&#x6253;&#x6270;
     * @memberof Chat
     * @type {boolean}
     */
    get mute() {
        return this.$get(&apos;mute&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x5DF2;&#x8BBE;&#x7F6E;&#x4E3A;&#x514D;&#x6253;&#x6270;
     * @param {boolean} mute &#x5DF2;&#x8BBE;&#x7F6E;&#x4E3A;&#x514D;&#x6253;&#x6270;
     * @memberof Chat
     */
    set mute(mute) {
        this.$set(&apos;mute&apos;, mute);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;&#x8BFB;&#x53D6; `hide` &#x5C5E;&#x6027;
     * @memberof Chat
     * @type {string}
     */
    get hidden() {
        return this.hide;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;&#x8BBE;&#x7F6E; `hide` &#x5C5E;&#x6027;
     * @param {boolean} hide &#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     */
    set hidden(hide) {
        this.hide = hide;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     * @type {string}
     */
    get hide() {
        return this.$get(&apos;hide&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;
     * @param {boolean} hide &#x5DF2;&#x7ECF;&#x9690;&#x85CF;&#xFF08;&#x5B58;&#x6863;&#xFF09;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     */
    set hide(hide) {
        this.$set(&apos;hide&apos;, hide);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x8BBE;&#x4E3A;&#x516C;&#x5F00;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get public() {
        return this.$get(&apos;public&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x5DF2;&#x8BBE;&#x4E3A;&#x516C;&#x5F00;&#x804A;&#x5929;
     * @param {boolean} flag &#x5DF2;&#x8BBE;&#x4E3A;&#x516C;&#x5F00;&#x804A;&#x5929;
     * @memberof Chat
     */
    set public(flag) {
        this.$set(&apos;public&apos;, flag);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x521B;&#x5EFA;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     * @type {number}
     */
    get createdDate() {
        return this.$get(&apos;createdDate&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x521B;&#x5EFA;&#x65F6;&#x95F4;&#x6233;
     * @param {number} createdDate &#x804A;&#x5929;&#x521B;&#x5EFA;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     */
    set createdDate(createdDate) {
        this.$set(&apos;createdDate&apos;, createdDate);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x89E3;&#x6563;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     * @type {number}
     */
    get dismissDate() {
        return this.$get(&apos;dismissDate&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x89E3;&#x6563;&#x65F6;&#x95F4;&#x6233;
     * @param {number} dismissDate &#x804A;&#x5929;&#x89E3;&#x6563;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     */
    set dismissDate(dismissDate) {
        this.$set(&apos;dismissDate&apos;, dismissDate);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x89E3;&#x6563;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get isDismissed() {
        return !!this.dismissDate;
    }

    /**
     * &#x5224;&#x65AD;&#x6307;&#x5B9A;&#x7684;&#x7528;&#x6237;&#x662F;&#x5426;&#x80FD;&#x591F;&#x89E3;&#x6563;&#x6B64;&#x804A;&#x5929;
     *
     * @param {Member|{id: number}|{account: string}} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x53EF;&#x4EE5;&#x89E3;&#x6563;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x662F;
     * @memberof Chat
     */
    canDismiss(user) {
        return !this.isDismissed &amp;&amp; this.isGroup &amp;&amp; this.isAdmin(user);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x7BA1;&#x7406;&#x5458;&#x96C6;&#x5408;
     * @memberof Chat
     * @type {Set&lt;string|number&gt;}
     */
    get admins() {
        return this.$get(&apos;admins&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x7BA1;&#x7406;&#x5458;
     * @param {Set&lt;string|number&gt;} admins &#x804A;&#x5929;&#x7BA1;&#x7406;&#x5458;
     * @memberof Chat
     */
    set admins(admins) {
        this.$set(&apos;admins&apos;, admins);
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x6B64;&#x804A;&#x5929;&#x7684;&#x7BA1;&#x7406;&#x5458;
     *
     * @param {Member|{id: number}|{account: string}} member &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x4E3A;&#x662F;&#x6B64;&#x804A;&#x5929;&#x7BA1;&#x7406;&#x5458;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x662F;
     * @memberof Chat
     */
    isAdmin(member) {
        if (typeof member !== &apos;object&apos;) {
            member = {id: member, account: member};
        }
        if (this.isSystem &amp;&amp; member.isSuperAdmin) {
            return true;
        }
        if (this.isOwner(member)) {
            return true;
        }
        const {admins} = this;
        if (admins &amp;&amp; admins.size) {
            return admins.has(member.id) || admins.has(member.account);
        }
        return false;
    }

    /**
     * &#x5411;&#x6B64;&#x804A;&#x5929;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x7BA1;&#x7406;&#x5458;
     *
     * @param {number} memberId &#x8981;&#x505A;&#x4E3A;&#x65B0;&#x7BA1;&#x7406;&#x5458;&#x7684; ID
     * @memberof Chat
     * @return {void}
     */
    addAdmin(memberId) {
        const {admins} = this;
        if (typeof memberId === &apos;object&apos;) {
            memberId = memberId.id;
        }
        admins.add(memberId);
        this.admins = admins;
    }

    /**
     * &#x83B7;&#x53D6;&#x767D;&#x540D;&#x5355;&#x8BBE;&#x7F6E;
     * @memberof Chat
     * @type {Set&lt;string&gt;}
     */
    get committers() {
        const committers = this.$get(&apos;committers&apos;);
        if (!committers || committers === &apos;$ADMINS&apos;) {
            return [];
        }
        return new Set(committers.split(&apos;,&apos;));
    }

    /**
     * &#x8BBE;&#x7F6E;&#x767D;&#x540D;&#x5355;&#x914D;&#x7F6E;
     * @param {string|Set&lt;string&gt;} committers &#x767D;&#x540D;&#x5355;
     * @memberof Chat
     */
    set committers(committers) {
        this.$set(&apos;committers&apos;, committers);
    }

    /**
     * &#x83B7;&#x53D6;&#x767D;&#x540D;&#x5355;&#x7C7B;&#x578B;
     * @memberof Chat
     * @type {string}
     */
    get committersType() {
        const committers = this.$get(&apos;committers&apos;);
        if ((this.isSystem || this.isGroup) &amp;&amp; committers &amp;&amp; committers !== &apos;$ALL&apos;) {
            if (committers === &apos;$ADMINS&apos;) {
                return COMMITTERS_TYPES.admins;
            }
            return COMMITTERS_TYPES.whitelist;
        }
        return COMMITTERS_TYPES.all;
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237;&#x662F;&#x5426;&#x5728;&#x767D;&#x540D;&#x5355;&#x4E2D;
     *
     * @param {number|{id: number}} member &#x7528;&#x6237; ID &#x6216;&#x8005;&#x7528;&#x6237;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x5728;&#x767D;&#x540D;&#x5355;&#x4E2D;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x5728;
     * @memberof Chat
     */
    isCommitter(member) {
        switch (this.committersType) {
        case COMMITTERS_TYPES.admins:
            return this.isAdmin(member);
        case COMMITTERS_TYPES.whitelist:
            if (typeof member === &apos;object&apos;) {
                member = member.id;
            }
            return this.isInWhitelist(member);
        default:
            return true;
        }
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x80FD;&#x591F;&#x91CD;&#x547D;&#x540D;&#x6B64;&#x804A;&#x5929;
     *
     * @param {Member|{id: number}|{account: string}} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x80FD;&#x591F;&#x91CD;&#x547D;&#x540D;&#x6B64;&#x804A;&#x5929;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;
     * @memberof Chat
     */
    canRename(user) {
        return !this.isRobot &amp;&amp; !this.isDismissed &amp;&amp; this.isCommitter(user) &amp;&amp; !this.isOne2One;
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x80FD;&#x591F;&#x9080;&#x8BF7;&#x5176;&#x4ED6;&#x6210;&#x5458;&#x53C2;&#x4E0E;&#x6B64;&#x804A;&#x5929;
     *
     * @param {Member|{id: number}|{account: string}} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x80FD;&#x591F;&#x9080;&#x8BF7;&#x5176;&#x4ED6;&#x6210;&#x5458;&#x53C2;&#x4E0E;&#x6B64;&#x804A;&#x5929;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;
     * @memberof Chat
     */
    canInvite(user) {
        return !this.isRobot &amp;&amp; !this.isDismissed &amp;&amp; (this.isAdmin(user) || this.isCommitter(user)) &amp;&amp; (!this.isSystem);
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x80FD;&#x591F;&#x5C06;&#x804A;&#x5929;&#x5185;&#x6210;&#x5458;&#x79FB;&#x9664;&#x6B64;&#x804A;&#x5929;
     *
     * @param {!(Member|{id: number}|{account: string})} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @param {!(Member|{id: number}|{account: string})} kickOfWho &#x8981;&#x79FB;&#x9664;&#x7684;&#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x80FD;&#x591F;&#x5C06;&#x804A;&#x5929;&#x5185;&#x6210;&#x5458;&#x79FB;&#x9664;&#x6B64;&#x804A;&#x5929;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;
     * @memberof Chat
     */
    canKickOff(user, kickOfWho) {
        return !this.isRobot &amp;&amp; this.isGroup &amp;&amp; !this.isSystem &amp;&amp; (!kickOfWho || kickOfWho.id !== user.id) &amp;&amp; this.isAdmin(user);
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x80FD;&#x591F;&#x5C06;&#x804A;&#x5929;&#x8BBE;&#x7F6E;&#x4E3A;&#x516C;&#x5F00;&#x6216;&#x8005;&#x53D6;&#x6D88;&#x516C;&#x5F00;&#x8BBE;&#x7F6E;
     *
     * @param {Member|{id: number}|{account: string}} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x80FD;&#x591F;&#x5C06;&#x804A;&#x5929;&#x8BBE;&#x7F6E;&#x4E3A;&#x516C;&#x5F00;&#x6216;&#x8005;&#x53D6;&#x6D88;&#x516C;&#x5F00;&#x8BBE;&#x7F6E;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;
     * @memberof Chat
     */
    canMakePublic(user) {
        return !this.isRobot &amp;&amp; !this.isDismissed &amp;&amp; this.isAdmin(user) &amp;&amp; this.isGroup;
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458;&#x662F;&#x5426;&#x662F;&#x80FD;&#x591F;&#x4FEE;&#x6539;&#x6B64;&#x804A;&#x5929;&#x7684;&#x767D;&#x540D;&#x5355;
     *
     * @param {Member|{id: number}|{account: string}} user &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x80FD;&#x591F;&#x4FEE;&#x6539;&#x6B64;&#x804A;&#x5929;&#x7684;&#x767D;&#x540D;&#x5355;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;
     * @memberof Chat
     */
    canSetCommitters(user) {
        return !this.isRobot &amp;&amp; !this.isDismissed &amp;&amp; this.isAdmin(user) &amp;&amp; !this.isOne2One;
    }

    /**
     * &#x5224;&#x65AD;&#x6B64;&#x804A;&#x5929;&#x5BF9;&#x4E8E;&#x6307;&#x5B9A;&#x7684;&#x7528;&#x6237;&#x662F;&#x5426;&#x53EA;&#x8BFB;&#xFF08;&#x65E0;&#x6CD5;&#x53D1;&#x9001;&#x6D88;&#x606F;&#xFF09;
     *
     * @param {Member|{id: number}|{account: string}} member &#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x4E3A;&#x53EA;&#x8BFB;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x662F;
     * @memberof Chat
     */
    isReadonly(member) {
        return this.isRobot || this.isDeleteOne2One || this.isDismissed || !this.isCommitter(member);
    }

    get visible() {
        if (this._visible === undefined) {
            const {dismissDate} = this;
            if (dismissDate) {
                const now = new Date().getTime();
                this._visible = now &lt;= (dismissDate + DISMISS_VISIBLE_TIME);
            } else {
                this._visible = true;
            }
        }
        return this._visible;
    }

    get visibleDate() {
        const {dismissDate} = this;
        return dismissDate ? (dismissDate + DISMISS_VISIBLE_TIME) : 0;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x8BBE;&#x7F6E;&#x6709;&#x767D;&#x540D;&#x5355;
     * @memberof Chat
     * @type {boolean}
     */
    get hasWhitelist() {
        return this.committersType === COMMITTERS_TYPES.whitelist;
    }

    /**
     * &#x83B7;&#x53D6;&#x6B64;&#x804A;&#x5929;&#x7684;&#x767D;&#x540D;&#x5355;
     * @memberof Chat
     * @type {string}
     */
    get whitelist() {
        if (this.hasWhitelist) {
            const set = new Set();
            this.committers.forEach(x =&gt; {
                x = Number.parseInt(x, 10);
                if (!Number.isNaN(x)) {
                    set.add(x);
                }
            });
            return set;
        }
        return null;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x6B64;&#x804A;&#x5929;&#x7684;&#x767D;&#x540D;&#x5355;
     *
     * @memberof Chat
     * @param {Set&lt;string&gt;} value &#x767D;&#x540D;&#x5355;
     */
    set whitelist(value) {
        if (!this.isGroupOrSystem) {
            value = &apos;&apos;;
        }
        this.$set(&apos;committers&apos;, value);
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237; ID &#x662F;&#x5426;&#x5728;&#x767D;&#x540D;&#x5355;&#x4E2D;
     *
     * @param {number} memberId &#x7528;&#x6237; ID
     * @param {?Set&lt;number&gt;} whitelist &#x767D;&#x540D;&#x5355;
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x5728;&#x767D;&#x540D;&#x5355;&#x4E2D;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x5728;
     * @memberof Chat
     */
    isInWhitelist(memberId, whitelist) {
        if (typeof memberId === &apos;object&apos;) {
            memberId = memberId.id;
        }
        whitelist = whitelist || this.whitelist;
        if (whitelist) {
            return whitelist.has(memberId);
        }
        return false;
    }

    /**
     * &#x5C06;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237; ID &#x6DFB;&#x52A0;&#x5230;&#x767D;&#x540D;&#x5355;&#x4E2D;
     *
     * @param {number} memberId &#x7528;&#x6237; ID
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x6DFB;&#x52A0;&#x6210;&#x529F;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x6DFB;&#x52A0;&#x5931;&#x8D25;
     * @memberof Chat
     */
    addToWhitelist(memberId) {
        const {whitelist} = this;
        if (whitelist) {
            if (typeof memberId === &apos;object&apos;) {
                memberId = memberId.id;
            }
            if (!whitelist.has(memberId)) {
                whitelist.add(memberId);
                this.whitelist = whitelist;
                return true;
            }
        }
        return false;
    }

    /**
     * &#x5C06;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237; ID &#x4ECE;&#x767D;&#x540D;&#x5355;&#x4E2D;&#x79FB;&#x9664;
     *
     * @param {number} memberId &#x7528;&#x6237; ID
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x79FB;&#x9664;&#x6210;&#x529F;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x79FB;&#x9664;&#x5931;&#x8D25;
     * @memberof Chat
     */
    removeFromWhitelist(memberId) {
        const {whitelist} = this;
        if (whitelist) {
            if (typeof memberId === &apos;object&apos;) {
                memberId = memberId.id;
            }
            if (whitelist.has(memberId)) {
                whitelist.delete(memberId);
                this.whitelist = whitelist;
                return true;
            }
        }
        return false;
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;&#x7528;&#x6237;&#x540D;
     * @memberof Chat
     * @type {string}
     */
    get createdBy() {
        return this.$get(&apos;createdBy&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;&#x7528;&#x6237;&#x540D;
     * @param {string} createdBy &#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;&#x7528;&#x6237;&#x540D;
     * @memberof Chat
     */
    set createdBy(createdBy) {
        this.$set(&apos;createdBy&apos;, createdBy);
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x6210;&#x5458; ID &#x96C6;&#x5408;
     * @memberof Chat
     * @type {Set&lt;number&gt;}
     */
    get members() {
        return this.$get(&apos;members&apos;);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x6210;&#x5458;
     * @param {number[]|Member[]} newMembers &#x804A;&#x5929;&#x6210;&#x5458;
     * @memberof Chat
     */
    set members(newMembers) {
        if (newMembers.length) {
            if (typeof newMembers[0] === &apos;object&apos;) {
                this.resetMembers(newMembers);
            } else {
                this.$set(&apos;members&apos;, new Set(newMembers));
                this._membersSet = null;
            }
        } else {
            this._membersSet = [];
        }
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x6210;&#x5458; ID &#x662F;&#x5426;&#x5728;&#x6B64;&#x804A;&#x5929;&#x6210;&#x5458;&#x96C6;&#x5408;&#x4E2D;
     *
     * @param {number|{id: number}} memberId &#x804A;&#x5929;&#x6210;&#x5458;&#x5BF9;&#x8C61;&#x6216;&#x8005;&#x6210;&#x5458; ID
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x5728;&#x6B64;&#x804A;&#x5929;&#x6210;&#x5458;&#x96C6;&#x5408;&#x4E2D;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x5728;
     * @memberof Chat
     */
    isMember(memberId) {
        if (typeof memberId === &apos;object&apos;) {
            memberId = memberId.id;
        }
        const {members} = this;
        return members &amp;&amp; members.has(memberId);
    }

    /**
     * &#x8BBE;&#x7F6E;&#x804A;&#x5929;&#x6210;&#x5458;
     * @param {Member[]} members &#x804A;&#x5929;&#x6210;&#x5458;
     * @return {void}
     */
    resetMembers(members) {
        this._membersSet = members;
        this.$set(&apos;members&apos;, new Set(members.map(member =&gt; member.id)));
    }

    /**
     * &#x5C06;&#x6210;&#x5458;&#x6DFB;&#x52A0;&#x5230;&#x804A;&#x5929;&#x4E2D;
     *
     * @param {...Member} newMembers &#x65B0;&#x5230;&#x6210;&#x5458;
     * @memberof Chat
     * @return {void}
     */
    addMember(...newMembers) {
        const {members} = this;
        if (!members.size) {
            this._membersSet = [];
        }
        newMembers.forEach(member =&gt; {
            if (!members.has(member.id)) {
                members.add(member.id);
                if (this._membersSet) {
                    this._membersSet.push(member);
                }
            }
        });
        this.$set(&apos;members&apos;, members);
    }

    /**
     * &#x4ECE;&#x7CFB;&#x7EDF;&#x66F4;&#x65B0;&#x804A;&#x5929;&#x6210;&#x5458;&#x5217;&#x8868;
     *
     * @param {{get: function(id: number):Member}} appMembers &#x7528;&#x4E8E;&#x4ECE;&#x7CFB;&#x7EDF;&#x83B7;&#x53D6;&#x6210;&#x5458;&#x4FE1;&#x606F;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {void}
     * @memberof Chat
     */
    updateMembersSet(appMembers) {
        this._membersSet = Array.from(this.members).map(memberId =&gt; (appMembers.get(memberId)));
        if (this.isGroupOrSystem) {
            this._membersSet = this._membersSet.filter(m =&gt; !m.temp &amp;&amp; !m.isDeleted);
        }
    }

    /**
     * &#x83B7;&#x53D6;&#x804A;&#x5929;&#x6210;&#x5458;&#x6570;&#x76EE;
     *
     * @param {{get: function(id: number):Member}} appMembers &#x7528;&#x4E8E;&#x4ECE;&#x7CFB;&#x7EDF;&#x83B7;&#x53D6;&#x6210;&#x5458;&#x4FE1;&#x606F;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {number} &#x6210;&#x5458;&#x6570;&#x76EE;
     * @memberof Chat
     */
    getMembersCount(appMembers) {
        return this.getMembersSet(appMembers).length;
    }

    /**
     * &#x4ECE;&#x7CFB;&#x7EDF;&#x83B7;&#x53D6;&#x804A;&#x5929;&#x6210;&#x5458;&#x5217;&#x8868;
     *
     * @param {{get: function(id: number):Member}} appMembers &#x7528;&#x4E8E;&#x4ECE;&#x7CFB;&#x7EDF;&#x83B7;&#x53D6;&#x6210;&#x5458;&#x4FE1;&#x606F;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {Member[]} &#x804A;&#x5929;&#x6210;&#x5458;&#x5217;&#x8868;
     * @memberof Chat
     */
    getMembersSet(appMembers) {
        if (this.type === TYPES.system) {
            return appMembers.all.filter(x =&gt; !x.isDeleted);
        }
        if (!this._membersSet || this._membersSetUpdateId !== this.updateId) {
            this.updateMembersSet(appMembers);
            this._membersSetUpdateId = this.updateId;
        }
        return this._membersSet;
    }

    /**
     * &#x83B7;&#x53D6;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;&#x5BF9;&#x65B9;&#x6210;&#x5458;
     *
     * @param {{members: {get: function(id: number):Member}}} app &#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x6210;&#x5458;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {Member} &#x5BF9;&#x65B9;&#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @memberof Chat
     */
    getTheOtherOne(app) {
        if (this.isOne2One) {
            const appMembers = app.members;
            const currentUserId = app.user.id;
            if (!this._theOtherOneId) {
                this._theOtherOneId = Array.from(this.members).find(x =&gt; x !== currentUserId);
            }
            if (this._theOtherOneId) {
                const member = appMembers.get(this._theOtherOneId);
                if (member &amp;&amp; member.temp) {
                    this._membersSet = null;
                }
                return member;
            }
            return this._theOtherOne;
        }
        return null;
    }

    /**
     * &#x5224;&#x65AD;&#x804A;&#x5929;&#x662F;&#x5426;&#x5728;&#x7EBF;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x4E00;&#x5BF9;&#x4E00;&#x804A;&#x5929;&#x5219;&#x5224;&#x65AD;&#x5BF9;&#x65B9;&#x6210;&#x5458;&#x72B6;&#x6001;&#x662F;&#x5426;&#x5728;&#x7EBF;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x5176;&#x4ED6;&#x804A;&#x5929;&#x5219;&#x76F4;&#x63A5;&#x5224;&#x5B9A;&#x4E3A;&#x5728;&#x7EBF;
     *
     * @param {{members: {get: function(id: number):Member}}} app &#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x6210;&#x5458;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x4E3A; `true` &#x5219;&#x4E3A;&#x5728;&#x7EBF;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x5728;&#x7EBF;
     * @memberof Chat
     */
    isOnline(app) {
        if (this.isOne2One) {
            const otherOne = this.getTheOtherOne(app);
            return otherOne &amp;&amp; otherOne.isOnline;
        }
        return true;
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237;&#x662F;&#x5426;&#x662F;&#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;
     *
     * @param {Member|{id: number}|{account: string}} user &#x804A;&#x5929;&#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x662F;&#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x662F;&#x804A;&#x5929;&#x7684;&#x521B;&#x5EFA;&#x8005;
     * @memberof Chat
     */
    isOwner(user) {
        return user.id === this.createdBy || user.account === this.createdBy;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x80FD;&#x591F;&#x8BA9;&#x5176;&#x4ED6;&#x6210;&#x5458;&#x81EA;&#x7531;&#x52A0;&#x5165;
     * @memberof Chat
     * @readonly
     * @type {boolean}
     */
    get canJoin() {
        return !this.isDismissed &amp;&amp; this.public &amp;&amp; this.isGroup;
    }

    /**
     * &#x5224;&#x65AD;&#x7ED9;&#x5B9A;&#x7684;&#x7528;&#x6237;&#x662F;&#x5426;&#x80FD;&#x591F;&#x9000;&#x51FA;&#x8BA8;&#x8BBA;&#x7EC4;
     *
     * @param {Member|{id: number}|{account: string}} user &#x804A;&#x5929;&#x6210;&#x5458;&#x5BF9;&#x8C61;
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x4E3A;&#x80FD;&#x591F;&#x9000;&#x51FA;&#x8BA8;&#x8BBA;&#x7EC4;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x4E0D;&#x80FD;&#x591F;&#x9000;&#x51FA;&#x8BA8;&#x8BBA;&#x7EC4;
     * @memberof Chat
     */
    canExit(user) {
        return this.isGroup &amp;&amp; !this.isOwner(user);
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x9690;&#x85CF;&#x6B64;&#x804A;&#x5929;
     * @memberof Chat
     * @readonly
     * @type {boolean}
     */
    get canHide() {
        return this.isGroup;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x662F;&#x7CFB;&#x7EDF;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get isSystem() {
        return this.type === TYPES.system || this.type === TYPES.robot;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x662F;&#x8BA8;&#x8BBA;&#x7EC4;&#x6216;&#x7CFB;&#x7EDF;&#x804A;&#x5929;
     * @memberof Chat
     * @type {boolean}
     */
    get isGroupOrSystem() {
        return this.isGroup || this.isSystem;
    }

    /**
     * &#x83B7;&#x53D6;&#x6B64;&#x804A;&#x5929;&#x7684;&#x672A;&#x8BFB;&#x6D88;&#x606F;&#x6570;&#x76EE;
     * @memberof Chat
     * @type {number}
     */
    get noticeCount() {
        return this._noticeCount || 0;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x6B64;&#x804A;&#x5929;&#x7684;&#x672A;&#x8BFB;&#x6D88;&#x606F;&#x6570;&#x76EE;
     * @param {number} count &#x6B64;&#x804A;&#x5929;&#x7684;&#x672A;&#x8BFB;&#x6D88;&#x606F;&#x6570;&#x76EE;
     * @memberof Chat
     */
    set noticeCount(count) {
        this._noticeCount = count;
    }

    /**
     * &#x6E05;&#x9664;&#x6B64;&#x804A;&#x5929;&#x7684;&#x672A;&#x8BFB;&#x6D88;&#x606F;&#x6570;&#x76EE;
     *
     * @return {ChatMessage[]} &#x5DF2;&#x65B0;&#x6807;&#x8BB0;&#x4E3A;&#x5DF2;&#x8BFB;&#x7684;&#x6D88;&#x606F;&#x6E05;&#x5355;
     * @memberof Chat
     */
    muteNotice() {
        this._noticeCount = 0;
        const mutedMessages = [];
        this._messages.forEach(message =&gt; {
            if (message.unread) {
                message.unread = false;
                mutedMessages.push(message);
            }
        });
        this.renewUpdateId();
        return mutedMessages;
    }

    /**
     * &#x83B7;&#x53D6;&#x6B64;&#x804A;&#x5929;&#x662F;&#x5426;&#x5DF2;&#x88AB;&#x8BBE;&#x7F6E;&#x4E3A;&#x514D;&#x6253;&#x6270;&#x6216;&#x8005;&#x9690;&#x85CF;&#xFF08;&#x5DF2;&#x5B58;&#x6863;&#xFF09;
     * @memberof Chat
     * @readonly
     * @type {boolean}
     */
    get isMuteOrHidden() {
        return this.mute || this.hidden;
    }

    /**
     * &#x83B7;&#x53D6;&#x6B64;&#x804A;&#x5929;&#x7F13;&#x5B58;&#x7684;&#x6D88;&#x606F;&#x5217;&#x8868;
     * @memberof Chat
     * @readonly
     * @type {ChatMessage[]}
     */
    get messages() {
        return this._messages || [];
    }

    /**
     * &#x83B7;&#x53D6;&#x4E0A;&#x6B21;&#x5728;&#x754C;&#x9762;&#x4E0A;&#x6FC0;&#x6D3B;&#x7684;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     * @type {number}
     */
    get lastActiveTime() {
        let lastActiveTime = this.$get(&apos;lastActiveTime&apos;);
        if (!lastActiveTime) {
            lastActiveTime = this.createdDate;
        }
        return lastActiveTime || 0;
    }

    /**
     * &#x8BBE;&#x7F6E;&#x4E0A;&#x6B21;&#x5728;&#x754C;&#x9762;&#x4E0A;&#x6FC0;&#x6D3B;&#x7684;&#x65F6;&#x95F4;&#x6233;
     * @param {number} time &#x4E0A;&#x6B21;&#x5728;&#x754C;&#x9762;&#x4E0A;&#x6FC0;&#x6D3B;&#x7684;&#x65F6;&#x95F4;&#x6233;
     * @memberof Chat
     */
    set lastActiveTime(time) {
        this.$set(&apos;lastActiveTime&apos;, time);
    }

    /**
     * &#x5C06;&#x804A;&#x5929;&#x8BBE;&#x7F6E;&#x5DF2;&#x6FC0;&#x6D3B;
     * @return {void}
     * @memberof Chat
     */
    makeActive() {
        this.lastActiveTime = new Date().getTime();
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x6709;&#x7F13;&#x5B58;&#x6D88;&#x606F;
     * @memberof Chat
     * @type {boolean}
     */
    get hasSetMessages() {
        return !!this._messages;
    }

    /**
     * &#x5C06;&#x804A;&#x5929;&#x6D88;&#x606F;&#x6DFB;&#x52A0;&#x5230;&#x7F13;&#x5B58;
     *
     * @param {ChatMessage[]} messages &#x8981;&#x7F13;&#x5B58;&#x7684;&#x804A;&#x5929;&#x5217;&#x8868;
     * @param {number} userId &#x7528;&#x6237; ID
     * @param {boolean} [localMessage=false] &#x662F;&#x5426;&#x6765;&#x6E90;&#x4E8E;&#x672C;&#x5730;&#x6570;&#x636E;&#x6D88;&#x606F;
     * @param {boolean} [skipOld=false] &#x662F;&#x5426;&#x5FFD;&#x7565;&#x5DF2;&#x7F13;&#x5B58;&#x7684;&#x6D88;&#x606F;
     * @returns {Chat} &#x8FD4;&#x56DE;&#x81EA;&#x8EAB;&#x7528;&#x4E8E;&#x94FE;&#x5F0F;&#x8C03;&#x7528;
     * @memberof Chat
     */
    addMessages(messages, userId, localMessage = false, skipOld = false) {
        if (!Array.isArray(messages)) {
            messages = [messages];
        }
        if (!this._messages) {
            this._messages = [];
        }

        if (!messages.length) {
            return;
        }

        let {noticeCount, lastActiveTime} = this;
        const now = skipOld ? (new Date().getTime()) : 0;
        messages.forEach(message =&gt; {
            if (message.date) {
                const checkMessage = this._messages.find(x =&gt; x.gid === message.gid);
                if (checkMessage) {
                    checkMessage.reset(message);
                } else if (skipOld &amp;&amp; (now - message.date) &gt; skipOld) {
                    return;
                } else {
                    this._messages.push(message);
                    if (!localMessage &amp;&amp; userId !== message.senderId) {
                        message.unread = true;
                        noticeCount += 1;
                    } else {
                        message.unread = false;
                    }
                }
                if (lastActiveTime &lt; message.date) {
                    lastActiveTime = message.date;
                }
                if (message.order) {
                    this._maxMsgOrder = Math.max(this._maxMsgOrder, message.order);
                }
            } else if (DEBUG) {
                console.warn(&apos;The message date is not defined.&apos;, message);
            }
        });
        this.lastActiveTime = lastActiveTime;
        this.noticeCount = noticeCount;

        this._messages = ChatMessage.sort(this._messages);

        this.renewUpdateId();

        return this;
    }

    /**
     * &#x83B7;&#x53D6;&#x7F13;&#x5B58;&#x4E2D;&#x6700;&#x65B0;&#x7684;&#x4E00;&#x4E2A;&#x804A;&#x5929;&#x6D88;&#x606F;
     * @memberof Chat
     * @type {ChatMessage}
     */
    get lastMessage() {
        return this._messages &amp;&amp; this._messages[this._messages.length - 1];
    }

    /**
     * &#x4ECE;&#x7F13;&#x5B58;&#x4E2D;&#x79FB;&#x9664;&#x6307;&#x5B9A; GID &#x7684;&#x804A;&#x5929;&#x6D88;&#x606F;
     *
     * @param {string} messageGid &#x804A;&#x5929;&#x6D88;&#x606F; GID
     * @returns {boolean} &#x5982;&#x679C;&#x8FD4;&#x56DE; `true` &#x5219;&#x79FB;&#x9664;&#x6210;&#x529F;&#xFF0C;&#x5426;&#x5219;&#x4E3A;&#x79FB;&#x9664;&#x5931;&#x8D25;&#xFF08;&#x53EF;&#x80FD;&#x662F;&#x672A;&#x627E;&#x5230;&#x6307;&#x5B9A;&#x7684;&#x804A;&#x5929;&#x6D88;&#x606F;&#xFF09;
     * @memberof Chat
     */
    removeMessage(messageGid) {
        const {messages} = this;
        if (messages.length) {
            const findIndex = messages.findIndex(x =&gt; (x.id === messageGid || x.gid === messageGid));
            if (findIndex &gt; -1) {
                this._messages.splice(findIndex, 1);
                return true;
            }
        }
        return false;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x4ECE;&#x6570;&#x636E;&#x5E93;&#x52A0;&#x8F7D;&#x5B8C;&#x6240;&#x6709;&#x6D88;&#x606F;&#x5230;&#x7F13;&#x5B58;
     * @memberof Chat
     * @type {boolean}
     */
    get isLoadingOver() {
        return this.loadingOffset === true;
    }

    /**
     * &#x83B7;&#x53D6;&#x662F;&#x5426;&#x662F;&#x7B2C;&#x4E00;&#x6B21;&#x4ECE;&#x6570;&#x636E;&#x5E93;&#x52A0;&#x8F7D;&#x6D88;&#x606F;
     * @memberof Chat
     * @type {boolean}
     */
    get isFirstLoaded() {
        return this.loadingOffset !== undefined;
    }

    /**
     * &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x804A;&#x5929;&#x7C7B;&#x5B9E;&#x4F8B;
     *
     * @static
     * @param {Object&lt;string,any&gt;|Chat} chat &#x804A;&#x5929;&#x5C5E;&#x6027;&#x5BF9;&#x8C61;&#x6216;&#x8005;&#x804A;&#x5929;&#x5B9E;&#x4F8B;
     * @return {Chat} &#x804A;&#x5929;&#x7C7B;&#x5B9E;&#x4F8B;
     * @memberof Chat
     */
    static create(chat) {
        if (chat instanceof Chat) {
            return chat;
        }
        return new Chat(chat);
    }

    /**
     * &#x5BF9;&#x804A;&#x5929;&#x5217;&#x8868;&#x8FDB;&#x884C;&#x6392;&#x5E8F;&#xFF0C;&#x6392;&#x5E8F;&#x89C4;&#x5219; `orders` &#x53EF;&#x4EE5;&#x4E3A;&#x4EE5;&#x4E0B;&#x503C;&#xFF1A;
     * - `function(c1: Member, c2: Member):number`&#xFF0C;&#x81EA;&#x5B9A;&#x4E49;&#x6392;&#x5E8F;&#x51FD;&#x6570;&#xFF1B;
     * - &#x4E00;&#x4E2A;&#x7528;&#x9017;&#x53F7;&#x5206;&#x9694;&#x7684;&#x6839;&#x636E;&#x5C5E;&#x6027;&#x6392;&#x5E8F;&#x7684;&#x5C5E;&#x6027;&#x540D;&#x79F0;&#x8868;&#xFF1B;
     * - &#x6839;&#x636E;&#x5C5E;&#x6027;&#x6392;&#x5E8F;&#x7684;&#x5C5E;&#x6027;&#x540D;&#x79F0;&#x8868;&#x6570;&#x7EC4;&#x3002;
     * &#x9ED8;&#x8BA4;&#x7684;&#x6392;&#x5E8F;&#x89C4;&#x5219;&#x4E3A;&#xFF1A;`[&apos;star&apos;, &apos;notice&apos;, &apos;hide&apos;, &apos;mute&apos;, &apos;lastActiveTime&apos;, &apos;online&apos;, &apos;createDate&apos;, &apos;name&apos;, &apos;id&apos;]`&#x3002;
     * @param  {Chat[]} chats &#x8981;&#x6392;&#x5E8F;&#x7684;&#x804A;&#x5929;&#x5217;&#x8868;
     * @param  {array|string|function(c1: Chat, c2: Chat):number}  orders &#x6392;&#x5E8F;&#x89C4;&#x5219;
     * @param  {{members: {get: function(id: number):Member}}} app &#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x6210;&#x5458;&#x7684;&#x8F85;&#x52A9;&#x5BF9;&#x8C61;
     * @return {Chat[]} &#x6392;&#x5E8F;&#x540E;&#x7684;&#x804A;&#x5929;&#x5217;&#x8868;
     */
    static sort(chats, orders, app) {
        if (chats.length &lt; 2) {
            return chats;
        }
        if (typeof orders === &apos;function&apos;) {
            return chats.sort(orders);
        }
        if (!orders || orders === &apos;default&apos; || orders === true) {
            orders = [&apos;star&apos;, &apos;notice&apos;, &apos;hide&apos;, &apos;mute&apos;, &apos;lastActiveTime&apos;, &apos;online&apos;, &apos;createDate&apos;, &apos;name&apos;, &apos;id&apos;];
        } else if (orders === &apos;onlineFirst&apos;) {
            orders = [&apos;star&apos;, &apos;notice&apos;, &apos;hide&apos;, &apos;online&apos;, &apos;mute&apos;, &apos;lastActiveTime&apos;, &apos;createDate&apos;, &apos;name&apos;, &apos;id&apos;];
        } else if (typeof orders === &apos;string&apos;) {
            orders = orders.split(&apos; &apos;);
        }
        let isFinalInverse = false;
        if (orders[0] === &apos;-&apos; || orders[0] === -1) {
            isFinalInverse = true;
            orders.shift();
        }
        return chats.sort((y, x) =&gt; {
            let result = 0;
            for (let order of orders) {
                if (result !== 0) break;
                if (typeof order === &apos;function&apos;) {
                    result = order(y, x);
                } else {
                    const isInverse = order[0] === &apos;-&apos;;
                    if (isInverse) order = order.substr(1);
                    let xValue;
                    let yValue;
                    switch (order) {
                    case &apos;hide&apos;:
                    case &apos;mute&apos;:
                        result = (x[order] ? 0 : 1) - (y[order] ? 0 : 1);
                        break;
                    case &apos;isSystem&apos;:
                    case &apos;star&apos;:
                        result = (x[order] ? 1 : 0) - (y[order] ? 1 : 0);
                        break;
                    case &apos;online&apos;:
                        if (app) {
                            result = (x.isOnline(app) ? 1 : 0) - (y.isOnline(app) ? 1 : 0);
                        }
                        break;
                    default:
                        if (order === &apos;name&apos; &amp;&amp; app) {
                            xValue = x.getDisplayName(app, false);
                            yValue = y.getDisplayName(app, false);
                        } else if (order === &apos;namePinyin&apos;) {
                            xValue = x.getPinYin(app);
                            yValue = y.getPinYin(app);
                        } else {
                            xValue = x[order];
                            yValue = y[order];
                        }
                        if (xValue === undefined || xValue === null) xValue = 0;
                        if (yValue === undefined || yValue === null) yValue = 0;
                        // eslint-disable-next-line no-nested-ternary
                        result = xValue &gt; yValue ? 1 : (xValue === yValue ? 0 : -1);
                    }
                    result *= isInverse ? (-1) : 1;
                }
            }
            return result * (isFinalInverse ? (-1) : 1);
        });
    }
}
</code></pre>

</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
